#define _CRT_SECURE_NO_WARNINGS

#include "LTNode.h"

void test1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	LTPopBack(plist);
	LTPopBack(plist);
	LTPopBack(plist);
	LTPopBack(plist);
	LTPrint(plist);

	LTPushFront(plist, 1);
	LTPushFront(plist, 2);
	LTPushFront(plist, 3);
	LTPushFront(plist, 4);
	LTPrint(plist);

	LTPopFront(plist);
	LTPopFront(plist);
	LTPopFront(plist);
	LTPopFront(plist);
	LTPopFront(plist);

	LTPrint(plist);


}

void test2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTNode* pos = LTFind(plist, 2);
	if (pos == NULL)
	{
		printf("Find fail\n");
		return;
	}
	LTPrint(plist);
	//LTPrint(pos);
	LTInsert(pos, 5);
	LTInsert(pos, 6);
	LTInsert(pos, 7);
	LTPrint(plist);
	LTErase(pos);
	pos = NULL;
	LTPrint(plist);


	LTDestory(plist);
	plist = NULL;

}


int main()
{
	//test1();
	test2();
	return 0;
}